const routes = [
  {
    path: '/index',
    name: 'index',
    component: () => import('../views/Index.vue')
  },
  {
    path: '/baobaotuan',
    name: 'baobaotuan',
    component: () => import('../views/Tuan.vue'),
    children: [// 二级路由
      {
        path: '/baobaotuan/Snapped',
        name: 'Snapped',
        component: () => import('../views/baobaotuan/baobaotuan-Snapped.vue')
      },
      {
        path: '/baobaotuan/Notice',
        name: 'Notice',
        component: () => import('../views/baobaotuan/baobaotuan-Notice.vue')
      },
      {
        path: '/baobaotuan',
        redirect: '/baobaotuan/Snapped'//重定向
      },

    ]
  },
  {
    path: '/Orders',
    name: 'Orders',
    component: () => import('../views/Orders.vue')
  },
  {
    path: '/Mine',
    name: 'Mine',
    component: () => import('../views/Mine.vue')
  },
  {
    path: '/Commodity/:id',
    name: 'commodity',
    component: () => import('../views/Commodity//Commodity.vue')
  },
  {
    path: '/',
    redirect: 'index'//重定向，当8080端口后什么都没有的时候，就加载index页面
  },
  {
    //当输入的域名有问题时，就显示404报错
    path: '*',
    component: () => import('../views/NotFound.vue')
  }
]

export default routes;